#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project ：back 
@File    ：article_proto.py
@IDE     ：PyCharm 
@Author  ：七分是你
@Date    ：2024/7/13 下午1:48 
@explain : 
"""
from typing import Optional

from pydantic import BaseModel, Field


class ArticleInputData(BaseModel):
    id: Optional[int] = Field(default=None, description="ID", examples=["1"])
    cid: Optional[int] = Field(default=None, description="cid", examples=["1"])
    title: Optional[str] = Field(default=None, description="attach", examples=["test"])
    content: Optional[str] = Field(default=None, description="attach", examples=["test"])
    attach: Optional[str] = Field(default=None, description="attach", examples=["test"])
    thumb: Optional[str] = Field(default=None, description="thumb", examples=["1"])
    is_display: Optional[int] = Field(default=None, description="is_display", examples=["1"])
    link_url: Optional[str] = Field(default=None, description="link_url", examples=["test"])
    seo_keywords: Optional[str] = Field(default=None, description="seo_keywords", examples=["test"])
    seo_description: Optional[str] = Field(default=None, description="seo_description", examples=["test"])
    click: Optional[int] = Field(default=None, description="click", examples=["1"])
    addtime: Optional[int] = Field(default=None, description="addtime", examples=["1"])
    sort_id: Optional[int] = Field(default=None, description="sort_id", examples=["1"])
    source: Optional[int] = Field(default=None, description="source", examples=["1"])
    source_reprint: Optional[str] = Field(default=None, description="source_reprint", examples=["test"])


class ArticleData(BaseModel):
    id: Optional[int] = Field(default=None, description="ID", examples=["1"])
    cid: Optional[int] = Field(default=None, description="cid", examples=["1"])
    title: str
    content: str
    attach: Optional[str] = Field(default=None, description="attach", examples=["test"])
    thumb: Optional[str] = Field(default=None, description="thumb", examples=["1"])
    is_display: Optional[int] = Field(default=None, description="is_display", examples=["1"])
    link_url: Optional[str] = Field(default=None, description="link_url", examples=["test"])
    seo_keywords: Optional[str] = Field(default=None, description="seo_keywords", examples=["test"])
    seo_description: Optional[str] = Field(default=None, description="seo_description", examples=["test"])
    click: Optional[int] = Field(default=None, description="click", examples=["1"])
    addtime: Optional[int] = Field(default=None, description="addtime", examples=["1"])
    addtime_str: Optional[str] = Field(default=None, description="addtime_str", examples=["test"])
    sort_id: Optional[int] = Field(default=None, description="sort_id", examples=["1"])
    source: Optional[int] = Field(default=None, description="source", examples=["1"])
    source_reprint: Optional[str] = Field(default=None, description="source_reprint", examples=["test"])


class ArticleCategoryInput(BaseModel):
    id: Optional[int] = Field(default=None, description="ID", examples=["1"])
    name: Optional[str] = Field(default=None, description="name", examples=["test"])
    sort_id: Optional[int] = Field(default=None, description="ID", examples=["1"])
    seo_title: Optional[str] = Field(default=None, description="seo_title", examples=["test"])
    seo_description: Optional[str] = Field(default=None, description="seo_description", examples=["test"])
    seo_keywords: Optional[str] = Field(default=None, description="seo_keywords", examples=["test"])
    is_sys: Optional[int] = Field(default=0, description="is_sys", examples=["1"])


class DelRequest(BaseModel):
    ids: list[int]
